
package org.zjx.app.service;

import org.zjx.app.action.gather.GatherTaskBoxAction;
import org.zjx.command.state.AccountState;
import org.zjx.command.state.QuestState;
import org.zjx.window.action.Action;
import org.zjx.window.window.IWindow;

import java.io.File;

public class QuestServerAction extends Action {
    private static final String filePath = "quest_state.json";

    public QuestServerAction(IWindow targetWindow) {
        super(targetWindow);
    }

    @Override
    protected void doExecute() throws Exception {
        QuestState questState = stateManager.getState(QuestState.class);
        AccountState accountState = stateManager.getState(AccountState.class);
        String playerFilePath = accountState.getPlayerId() + "-" + filePath;

        targetWindow.submitAction(new GatherTaskBoxAction(targetWindow));

        stateManager.registerState(questState);
        stateManager.getGameState().setGatherQuest(true);
    }


}
